package com.service;

import java.sql.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.dao.PrizeDao;
import com.model.Prize;

@Service("prizeService")
@Transactional
public class PrizeServiceImpl implements PrizeService{
	@Autowired
	private PrizeDao prizeDao;
	
	
	public void add(Integer branchId,Prize prize) {
		prizeDao.add(branchId,prize);		
	}

	public List<Prize> getAll() {
		return prizeDao.getAll();
	}

	public Prize get(Integer id) {
		return prizeDao.get(id);
	}

	public void delete(Integer id) {
		prizeDao.delete(id);

	}

	public List<Prize> getByDate(Date from,Date to)
	{
		return prizeDao.getByDate(from, to);
	}


	public List<Prize> getAll(int page) {
		return prizeDao.getAll(page);

	}

	public int getNoOfRecords() {
		return prizeDao.getNoOfRecords();
	}

}
